package com.struts.web.manage.admin.corpor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.lg.system.CLGAction;
import com.lg.system.CSqlMap;
import com.struts.deal.admin.user.Deal;

public class ReceiptAction extends CLGAction {

	public ActionForward execute(ActionMapping actionMapping, ActionForm form,
			HttpServletRequest request,
			HttpServletResponse response) throws
			Exception {
		
		ReceiptForm aWebForm = (ReceiptForm)form;
		SqlMapClient sqlmap = CSqlMap.getSqlMapConfig();
		try{
			
			
			int count=0;
			
			count=sqlmap.update("T_USER_INFO.selectJobForUserExsist",aWebForm);
			
			if(count==0){
				sqlmap.insert("T_USER_INFO.insertJobForUser",aWebForm);
			}
			System.out.println("77777777777777777:");
			aWebForm=(ReceiptForm)sqlmap.queryForObject("T_USER_INFO.selectForReceiptInfo",aWebForm);
			System.out.println("8888888888888888888888:");
			System.out.println("2222222222222222222:"+aWebForm.getCorporName());
			request.setAttribute("ReceiptForm", aWebForm);
		}catch(Exception e){
			e.printStackTrace();
		}
		return actionMapping.getInputForward();
	}
}
